<% include ../pageHeader %>

<center>
    <div class="messagebox">
        <div class="messagebox-title"><%= __('reg_agreement') %></div>
        <div class="messagebox-content">
            <%- __('reg_agreement_text') %>
            <div align="center">
                <form name="aform" method="post" action="?act=agree">
                    <input name="_csrf" type="hidden" value="<%- ctx.csrf %>" />
                    <input name="agreesubmit" type="submit" id="agree" value=" <%= __('reg_agree') %> "
                           class="button"/> &nbsp;
                    <input type="button" name="return" value=" <%= __('reg_decline') %> "
                           onclick="javascript:history.go(-1);" class="button"/>
                </form>
            </div>
        </div>
    </div>
</center>
<script type="text/javascript" language="javascript">
  var secs = 9;
  var wait = secs * 1000;
  var agreetext = " <%= __('reg_agree') %> ";
  document.aform.agreesubmit.value = agreetext + '(' + secs + ') ';
  document.aform.agreesubmit.disabled = true;
  for (i = 1; i <= secs; i++) {
    window.setTimeout('update(' + i + ')', i * 1000);
  }
  window.setTimeout('timer()', wait);

  function update(num, value) {
    if (num == (wait / 1000)) {
      document.aform.agreesubmit.value = agreetext;
    } else {
      printnr = (wait / 1000) - num;
      document.aform.agreesubmit.value = agreetext + '(' + printnr + ') ';
    }
  }

  function timer() {
    document.aform.agreesubmit.disabled = false;
    document.aform.agreesubmit.value = agreetext;
  }
</script>

<% include ../pageFooter %>
